# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=kamene
pkgver=0.32
pkgrel=5
pkgdesc='Powerful interactive packet manipulation program (based on scapy) written in Python'
url='https://github.com/phaethon/kamene'
depends=('tcpdump' 'python' )
optdepends=('python-cryptography: WEP decryption, IPsec and certificate support'
            'python-pyx: psdump() and pdfdump() functions'
            'python-matplotlib: plotting support'
            'python-netifaces: network interface information support'
            'graphviz: conversations() method support'
            'sox: for VOIP support')
checkdepends=('python-cryptography' 'python-pyx' 'python-matplotlib' 'python-netifaces' 'graphviz' 'sox')
replaces=('scapy3k')
arch=('any')
license=('GPL2')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/phaethon/kamene/archive/v${pkgver}.tar.gz)
sha256sums=('8254333ddc1404ee2bcd73c4a2c23e4f9c59320738610512f23ea3dad3cde28d')
sha512sums=('ba0e7ceb41e0687a8b8deb743f4cc8dc00021200ae028faac0afc3a1f202ac2c2cfdc7ebd7ea6ab3af4790e8393c9d1ed5b8f80f16bf0783e5058f29d2038ea6')

build() {
  cd ${pkgname}-${pkgver}
  python setup.py build
}

check() {
  cd ${pkgname}-${pkgver}/test
  # Run only main tests, without network access
  #./run_tests -K netaccess -F
}

package() {
  cd ${pkgname}-${pkgver}
  python setup.py install -O1 --skip-build --root="${pkgdir}" --prefix=/usr
  install -Dm 644 doc/kamene/*.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 doc/kamene.1.gz -t "${pkgdir}/usr/share/man/man1"
}

# vim: ts=2 sw=2 et:
